import _, { trim } from 'lodash'

// 大洲
export const CONTINENT_LIST = [ 'EU', 'NA_SA', 'AS', 'AF', 'OA']
// 欧洲
export const EU = ['SJ', 'DK', 'UA', 'RU', 'BG', 'HR', 'IS', 'LI', 'HU', 'LU', 'SM', 'RS', 'AX', 'AT', 'AD', 'GR', 'DE', 'IT', 'LV', 'NO', 'CZ', 'MD', 'MC', 'SK', 'SI', 'GG', 'VA', 'BE', 'FR', 'FO', 'PL', 'BA', 'JE', 'IE', 'EE', 'SE', 'CH', 'BY', 'GI', 'LT', 'RO', 'FI', 'GB', 'NL', 'PT', 'ES', 'AL', 'MK', 'IM', 'MT', 'ME']
// 美洲
export const NA_SA = ['BQ', 'MS', 'BZ', 'CA', 'GT', 'CU', 'CR', 'LC', 'KN', 'BL', 'VC', 'PM', 'MX', 'DM', 'DO', 'AI', 'AG', 'NI', 'BS', 'BB', 'PA', 'CW', 'KY', 'GD', 'GL', 'MF', 'PR', 'HN', 'HT', 'JM', 'TC', 'TT', 'GP', 'BM', 'US', 'UM', 'VI', 'VG', 'SX', 'SV', 'AW', 'MQ', 'UY', 'EC', 'CO', 'GY', 'VE', 'PY', 'BR', 'CL', 'GF', 'BO', 'PE', 'SR', 'FK']
// 亚洲
export const AS = ['CN', 'BT', 'TL', 'UZ', 'YE', 'AM', 'IL', 'IQ', 'IR', 'QA', 'ID', 'IN', 'SY', 'KG', 'KZ', 'TM', 'TR', 'CX', 'TJ', 'CY', 'BD', 'NP', 'PS', 'PK', 'BH', 'BN', 'LK', 'SG', 'JP', 'KP', 'KH', 'GE', 'SA', 'TH', 'KW', 'CC', 'JO', 'MM', 'LA', 'PH', 'MN', 'VN', 'AZ', 'AF', 'OM', 'AR', 'AE', 'KR', 'MV', 'MY', 'LB']
// 非洲
export const AF = ['EH', 'CF', 'UG', 'TD', 'CV', 'GM', 'GN', 'GW', 'CG', 'CD', 'LY', 'LR', 'GH', 'GA', 'SS', 'ZA', 'BW', 'RW', 'ER', 'DJ', 'CM', 'ST', 'SH', 'TZ', 'EG', 'ET', 'SN', 'SL', 'SC', 'TG', 'AO', 'NG', 'NE', 'BF', 'BI', 'MA', 'SZ', 'MR', 'MU', 'ZW', 'RE', 'KM', 'CI', 'TN', 'SO', 'NA', 'KE', 'SD', 'IO', 'MZ', 'LS', 'BJ', 'ZM', 'GQ', 'DZ', 'MW', 'YT', 'MG', 'ML']
// 大洋洲
export const OA = ['GU', 'MP', 'TV', 'KI', 'FM', 'PG', 'PW', 'CK', 'SB', 'TK', 'FJ', 'NC', 'NZ', 'TO', 'PF', 'AU', 'NR', 'WF', 'VU', 'PN', 'NU', 'AS', 'WS', 'NF', 'MH']
export const COUNTRY_MAP = {
  EU,
  NA_SA,
  AS,
  AF,
  OA,
}

export const MIME_IMAGE_JPEG = 'image/jpeg'
export const MIME_PNG = 'image/png'

export const MIME_PDF = 'application/pdf'

export const MIME_CSV = 'text/csv'
export const MIME_XLS = 'application/vnd.ms-excel'
export const MIME_XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'

export const MIME_DOC = 'application/msword'
export const MIME_DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

export const MIME_PPT = 'application/vnd.ms-powerpoint'
export const MIME_PPTX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'

export const MIME_WPS = 'application/vnd.ms-works'

export const MIME_MP3 = 'video/mpeg'
export const MIME_MP4 = 'video/mp4'

export const MIME_TXT = 'text/plain'
export const MIME_XML = 'application/xml'

export const MIME_ZIP = 'application/zip'
export const MIME_ZIP_DIVERSE = 'application/x-zip-compressed'
export const MIME_RAR = 'application/vnd.rar'
export const MIME_RAR_DIVERSE = 'application/rar'
export const MIME_X_RAR = 'application/x-rar'
export const MIME_TAR = 'application/x-tar'
export const MIME_7Z = 'application/x-7z-compressed'
export const MIME_GZ = 'application/gzip'
export const MIME_GZ_DIVERSE = 'application/x-gzip'
export const MIME_XZ = 'application/x-xz'
export const MIME_BZ = 'application/x-bzip'
export const MIME_BZ2 = 'application/x-bzip2'

export const MIME_DIRECTORY = 'application/vnd.ccpit.dir'

// 龙心浏览器
export const MIME_WPS_XLS = 'application/wps-office.xls'
export const MIME_WPS_XLSX = 'application/wps-office.xlsx'
export const MIME_WPS_DOC = 'application/wps-office.doc'
export const MIME_WPS_DOCX = 'application/wps-office.docx'
export const MIME_WPS_PPT = 'application/wps-office.ppt'
export const MIME_WPS_PPTX = 'application/wps-office.pptx'

export const COMMON_MIME_TYPES = [
  MIME_IMAGE_JPEG,
  MIME_PNG,
  MIME_PDF,
  MIME_CSV,
  MIME_XLS,
  MIME_XLSX,
  MIME_DOC,
  MIME_DOCX,
  MIME_PPT,
  MIME_PPTX,
  MIME_WPS,
  MIME_MP3,
  MIME_MP4,
  MIME_TXT,
  MIME_XML,
  MIME_ZIP,
  MIME_ZIP_DIVERSE,
  MIME_GZ_DIVERSE,
  MIME_GZ,
  MIME_TAR,
  MIME_7Z,
  MIME_XZ,
  MIME_BZ,
  MIME_BZ2,
  MIME_RAR,
  MIME_RAR_DIVERSE,
  MIME_X_RAR,
  MIME_WPS_XLS,
  MIME_WPS_XLSX,
  MIME_WPS_DOC,
  MIME_WPS_DOCX,
  MIME_WPS_PPT,
  MIME_WPS_PPTX,
]

export const IMAGE_MIME_TYPES = [
  MIME_IMAGE_JPEG,
  MIME_PNG,
]

export const OFFICE_MIME_TYPES = [
  MIME_PDF,
  MIME_CSV,
  MIME_XLS,
  MIME_XLSX,
  MIME_DOC,
  MIME_DOCX,
  MIME_PPT,
  MIME_PPTX,
  MIME_WPS,
]

export const WORD_MIME_TYPES = [
  MIME_DOC,
  MIME_DOCX,
  MIME_WPS,
]

export const MONEY_UNIT = '万元'
export const MEMBER_APPLICATION_STATUS_DRAFT = 'DRAFT'
export const MEMBER_APPLICATION_STATUS_PENDING = 'PENDING'
export const MEMBER_APPLICATION_STATUS_REJECTED = 'REJECTED'
export const MEMBER_APPLICATION_STATUS_PASSED = 'PASSED'

export const MEMBER_APPLICATION_STATUS_OBJECT_ARRAY = [
  { id: MEMBER_APPLICATION_STATUS_PENDING, name: '待审核' },
  { id: MEMBER_APPLICATION_STATUS_PASSED, name: '已通过' },
  { id: MEMBER_APPLICATION_STATUS_REJECTED, name: '已退回' },
]
export const MEMBER_APPLICATION_STATUS_CONDITION = [
  { id: 'preliminaryReviewPending', name: '待初审', value: 'preliminaryReviewStatus: PENDING,secondaryReviewStatus: PENDING,finalReviewStatus: PENDING' },
  { id: 'secondaryReviewPending', name: '待复审', value: 'preliminaryReviewStatus: PASSED,secondaryReviewStatus: PENDING,finalReviewStatus: PENDING' },
  { id: 'finalReviewPending', name: '待终审', value: 'preliminaryReviewStatus: PASSED,secondaryReviewStatus: PASSED,finalReviewStatus: PENDING' },
  { id: 'passed', name: '已通过', value: 'preliminaryReviewStatus: PASSED,secondaryReviewStatus: PASSED,finalReviewStatus: PASSED' },
  { id: 'preliminaryReviewRejected', name: '初审拒绝', value: 'preliminaryReviewStatus: REJECTED,secondaryReviewStatus: PENDING,finalReviewStatus: PENDING' },
  { id: 'secondaryReviewRejected', name: '复审拒绝', value: 'preliminaryReviewStatus: PASSED,secondaryReviewStatus: REJECTED,finalReviewStatus: PENDING' },
  { id: 'finalReviewRejected', name: '终审拒绝', value: 'preliminaryReviewStatus: PASSED,secondaryReviewStatus: PASSED,finalReviewStatus: REJECTED' },
]

export const MEMBER_APPLICATION_STATUS = {
  DRAFT: '草稿',
  PENDING: '待审核',
  REJECTED: '已退回',
  PASSED: '已通过',
}

export const TYPE_MEMBER = 0
export const TYPE_TARGET_MEMBER = 2
export const TYPE_INDIRECT_MEMBER = 3
export const TYPE_SHARED_MEMBER = 4

export const MEMBER_TYPE_OBJECT_ARRAY = [
  { value: TYPE_MEMBER, label: '会员' },
  { value: TYPE_TARGET_MEMBER, label: '目标会员' },
  { value: TYPE_INDIRECT_MEMBER, label: '间接会员' },
  { value: TYPE_SHARED_MEMBER, label: '共同会员' },
]

export const TRADE_STATUS_CREATED = 0
export const TRADE_STATUS_PUBLISHED = 1

export const TRADE_STATUS_OBEJCT = {
  [TRADE_STATUS_CREATED]: '未发布',
  [TRADE_STATUS_PUBLISHED]: '已发布'
}

export const TRADE_STATUS_OBEJCT_OPTION = [
  {
    value: TRADE_STATUS_CREATED,
    label: '未发布'
  },
  {
    value: TRADE_STATUS_PUBLISHED,
    label: '已发布'
  },
]

// 交易类型
export const TRADE_TRANSACTION_TYPE_BUY = 0
export const TRADE_TRANSACTION_TYPE_SELL = 1

export const TRADE_TRANSACTION_TYPE = {
  [TRADE_TRANSACTION_TYPE_BUY]: '求购',
  [TRADE_TRANSACTION_TYPE_SELL]: '出售'
}

export const TRADE_TRANSACTION_TYPE_OPTION = [
  {
    value: TRADE_TRANSACTION_TYPE_BUY,
    label: '求购'
  },
  {
    value: TRADE_TRANSACTION_TYPE_SELL,
    label: '出售'
  },
]

// 行业类型
export const TRADE_PROFESSION_TYPE_FINANCE = 1
export const TRADE_PROFESSION_TYPE_HOTEL = 2
export const TRADE_PROFESSION_TYPE_ENERGY_CHEMICAL = 3
export const TRADE_PROFESSION_TYPE_ENERGY_SAVING = 4
export const TRADE_PROFESSION_TYPE_BUILDING_MATERIALS = 5
export const TRADE_PROFESSION_TYPE_MINERAL_METALLURGY = 6
export const TRADE_PROFESSION_TYPE_INFRASTRUCTURE = 7
export const TRADE_PROFESSION_TYPE_AGRICULTURE_FORESTRY_ANIMAL_HUSBANDRY_FISHERIES = 8
export const TRADE_PROFESSION_TYPE_MECHANICAL_ELECTRICAL = 9
export const TRADE_PROFESSION_TYPE_TRANSPORTATION_LOGISTICS = 10
export const TRADE_PROFESSION_TYPE_AUTO_PARTS = 11
export const TRADE_PROFESSION_TYPE_TEXTILE_CLOTHING = 12
export const TRADE_PROFESSION_TYPE_TRAVEL = 13
export const TRADE_PROFESSION_TYPE_CULTURE_SPORTS = 14
export const TRADE_PROFESSION_TYPE_MEDIA_ADVERTISING = 15
export const TRADE_PROFESSION_TYPE_HOME_APPLIANCES_DIGITAL = 16
export const TRADE_PROFESSION_TYPE_HOUSEHOLD_COMMODITY = 17
export const TRADE_PROFESSION_TYPE_FOOD_DRINK = 18
export const TRADE_PROFESSION_TYPE_MEDICAL_CARE = 19
export const TRADE_PROFESSION_TYPE_BIOLOGICAL_MEDICINE = 20
export const TRADE_PROFESSION_TYPE_IT = 21
export const TRADE_PROFESSION_TYPE_MINERAL_DEVELOPMENT = 22
export const TRADE_PROFESSION_TYPE_BUSINESS_TRADE = 23
export const TRADE_PROFESSION_TYPE_OTHER = 24
export const TRADE_PROFESSION_TYPE_COMPREHENSIVE = 25

export const TRADE_PROFESSION_TYPE = {
  [TRADE_PROFESSION_TYPE_FINANCE]: '金融',
  [TRADE_PROFESSION_TYPE_HOTEL]: '地产酒店',
  [TRADE_PROFESSION_TYPE_ENERGY_CHEMICAL]: '能源化工',
  [TRADE_PROFESSION_TYPE_ENERGY_SAVING]: '节能环保',
  [TRADE_PROFESSION_TYPE_BUILDING_MATERIALS]: '建筑建材',
  [TRADE_PROFESSION_TYPE_MINERAL_METALLURGY]: '矿产冶金',
  [TRADE_PROFESSION_TYPE_INFRASTRUCTURE]: '基础设施',
  [TRADE_PROFESSION_TYPE_AGRICULTURE_FORESTRY_ANIMAL_HUSBANDRY_FISHERIES]: '农林牧渔',
  [TRADE_PROFESSION_TYPE_MECHANICAL_ELECTRICAL]: '机械机电',
  [TRADE_PROFESSION_TYPE_TRANSPORTATION_LOGISTICS]: '交通物流',
  [TRADE_PROFESSION_TYPE_AUTO_PARTS]: '汽车汽配',
  [TRADE_PROFESSION_TYPE_TEXTILE_CLOTHING]: '纺织服饰',
  [TRADE_PROFESSION_TYPE_TRAVEL]: '旅游休闲',
  [TRADE_PROFESSION_TYPE_CULTURE_SPORTS]: '文化体育',
  [TRADE_PROFESSION_TYPE_MEDIA_ADVERTISING]: '传媒广告',
  [TRADE_PROFESSION_TYPE_HOME_APPLIANCES_DIGITAL]: '家电数码',
  [TRADE_PROFESSION_TYPE_HOUSEHOLD_COMMODITY]: '家居日用',
  [TRADE_PROFESSION_TYPE_FOOD_DRINK]: '食品饮料',
  [TRADE_PROFESSION_TYPE_MEDICAL_CARE]: '医疗保健',
  [TRADE_PROFESSION_TYPE_BIOLOGICAL_MEDICINE]: '生物医药',
  [TRADE_PROFESSION_TYPE_IT]: 'IT',
  [TRADE_PROFESSION_TYPE_MINERAL_DEVELOPMENT]: '海洋开发',
  [TRADE_PROFESSION_TYPE_BUSINESS_TRADE]: '商务贸易',
  [TRADE_PROFESSION_TYPE_OTHER]: '其他',
  [TRADE_PROFESSION_TYPE_COMPREHENSIVE]: '综合',
}

export const TRADE_PROFESSION_TYPE_OPTION = [
  {
    value: TRADE_PROFESSION_TYPE_FINANCE,
    label: '金融'
  },
  {
    value: TRADE_PROFESSION_TYPE_HOTEL,
    label: '地产酒店'
  },
  {
    value: TRADE_PROFESSION_TYPE_ENERGY_CHEMICAL,
    label: '能源化工'
  },
  {
    value: TRADE_PROFESSION_TYPE_ENERGY_SAVING,
    label: '节能环保'
  },
  {
    value: TRADE_PROFESSION_TYPE_BUILDING_MATERIALS,
    label: '建筑建材'
  },
  {
    value: TRADE_PROFESSION_TYPE_MINERAL_METALLURGY,
    label: '矿产冶金'
  },
  {
    value: TRADE_PROFESSION_TYPE_INFRASTRUCTURE,
    label: '基础设施'
  },
  {
    value: TRADE_PROFESSION_TYPE_AGRICULTURE_FORESTRY_ANIMAL_HUSBANDRY_FISHERIES,
    label: '农林牧渔11'
  },
  {
    value: TRADE_PROFESSION_TYPE_MECHANICAL_ELECTRICAL,
    label: '机械机电'
  },
  {
    value: TRADE_PROFESSION_TYPE_TRANSPORTATION_LOGISTICS,
    label: '交通物流'
  },
  {
    value: TRADE_PROFESSION_TYPE_AUTO_PARTS,
    label: '汽车汽配'
  },
  {
    value: TRADE_PROFESSION_TYPE_TEXTILE_CLOTHING,
    label: '纺织服饰'
  },
  {
    value: TRADE_PROFESSION_TYPE_TRAVEL,
    label: '旅游休闲'
  },
  {
    value: TRADE_PROFESSION_TYPE_CULTURE_SPORTS,
    label: '文化体育'
  },
  {
    value: TRADE_PROFESSION_TYPE_MEDIA_ADVERTISING,
    label: '传媒广告'
  },
  {
    value: TRADE_PROFESSION_TYPE_HOME_APPLIANCES_DIGITAL,
    label: '家电数码'
  },
  {
    value: TRADE_PROFESSION_TYPE_HOUSEHOLD_COMMODITY,
    label: '家居日用'
  },
  {
    value: TRADE_PROFESSION_TYPE_FOOD_DRINK,
    label: '食品饮料'
  },
  {
    value: TRADE_PROFESSION_TYPE_MEDICAL_CARE,
    label: '医疗保健'
  },
  {
    value: TRADE_PROFESSION_TYPE_BIOLOGICAL_MEDICINE,
    label: '生物医药'
  },
  {
    value: TRADE_PROFESSION_TYPE_IT,
    label: 'IT'
  },
  {
    value: TRADE_PROFESSION_TYPE_MINERAL_DEVELOPMENT,
    label: '海洋开发'
  },
  {
    value: TRADE_PROFESSION_TYPE_BUSINESS_TRADE,
    label: '商务贸易'
  },
  {
    value: TRADE_PROFESSION_TYPE_OTHER,
    label: '其他'
  },
  {
    value: TRADE_PROFESSION_TYPE_COMPREHENSIVE,
    label: '综合'
  },
]

export function patchProfessionTypeToString (professionType) {
  let arr = professionType?.split(',');
  let res = ''
  arr?.forEach(item => {
    const tmp = TRADE_PROFESSION_TYPE[trim(item, '#')]
    if (tmp) {
      res += tmp + ','
    }
  })
  if (res.length > 0) {
    res = res.substring(0, res.length - 1)
  }
  return res
}

// 发布人类型
export const TRADE_PUBLISHER_TYPE_PUBLISHER = 0
export const TRADE_PUBLISHER_TYPE_AGENT = 1

export const TRADE_PUBLISHER_TYPE = {
  [TRADE_PUBLISHER_TYPE_PUBLISHER]: '发布人',
  [TRADE_PUBLISHER_TYPE_AGENT]: '代理人',
}

// 项目类型
export const INVEST_PROJECT_TYPE_FUNDS = 51
export const INVEST_PROJECT_TYPE_PROJECT = 52
export const INVEST_PROJECT_TYPE_TENDERING_INVESTMENT = 53
export const INVEST_PROJECT_TYPE = {
  [INVEST_PROJECT_TYPE_FUNDS]: '找资金',
  [INVEST_PROJECT_TYPE_PROJECT]: '找项目',
  [INVEST_PROJECT_TYPE_TENDERING_INVESTMENT]: '招标和招商',
}

export const INVEST_PROJECT_TYPE_OPTION = [
  {value: INVEST_PROJECT_TYPE_FUNDS, label: '找资金'},
  {value: INVEST_PROJECT_TYPE_PROJECT, label: '找项目'},
  {value: INVEST_PROJECT_TYPE_TENDERING_INVESTMENT, label: '招标和招商'},
]

// 投资方式
export const INVEST_INVESTMENT_MODE_EQUITY = 61
export const INVEST_INVESTMENT_MODE_DEBT = 62
export const INVEST_INVESTMENT_MODE_FINANCIAL = 63
export const INVEST_INVESTMENT_MODE_BT_BOT = 64
export const INVEST_INVESTMENT_MODE_OTHER = 65
export const INVEST_INVESTMENT_MODE = {
  [INVEST_INVESTMENT_MODE_EQUITY]: '股权投资',
  [INVEST_INVESTMENT_MODE_DEBT]: '债权投资',
  [INVEST_INVESTMENT_MODE_FINANCIAL]: '金融投资',
  [INVEST_INVESTMENT_MODE_BT_BOT]: 'BT/BOT项目投资',
  [INVEST_INVESTMENT_MODE_OTHER]: 'BT/其他投资',
}

export const INVEST_INVESTMENT_MODE_OPTION = [
  {value:INVEST_INVESTMENT_MODE_EQUITY, label: '股权投资'},
  {value:INVEST_INVESTMENT_MODE_DEBT, label: '债权投资'},
  {value:INVEST_INVESTMENT_MODE_FINANCIAL, label: '金融投资'},
  {value:INVEST_INVESTMENT_MODE_BT_BOT, label: 'BT/BOT项目投资'},
  {value:INVEST_INVESTMENT_MODE_OTHER, label: 'BT/其他投资'},
]

// 融资方式
export const INVEST_FINANCING_MODE_EQUITY = 71
export const INVEST_FINANCING_MODE_OTHER = 72
export const INVEST_FINANCING_MODE_OVERALL_TRANSFER = 73
export const INVEST_FINANCING_MODE_UNLIMITED = 74
export const INVEST_FINANCING_MODE = {
  [INVEST_FINANCING_MODE_EQUITY]: '股权融资',
  [INVEST_FINANCING_MODE_OTHER]: '其他融资',
  [INVEST_FINANCING_MODE_OVERALL_TRANSFER]: '整体转让',
  [INVEST_FINANCING_MODE_UNLIMITED]: '不限',
}

export const INVEST_FINANCING_MODE_OPTION = [
  {value:INVEST_FINANCING_MODE_EQUITY, label: '股权融资'},
  {value:INVEST_FINANCING_MODE_OTHER, label: '其他融资'},
  {value:INVEST_FINANCING_MODE_OVERALL_TRANSFER, label: '整体转让'},
  {value:INVEST_FINANCING_MODE_UNLIMITED, label: '不限'},
]

// 招标和招商方式
export const INVEST_TENDERING_INVESTMENT_MODE_JOINT_VENTURE = 81
export const INVEST_TENDERING_INVESTMENT_MODE_SOLE_PROPRIETORSHIP = 82
export const INVEST_TENDERING_INVESTMENT_MODE_BT_BOT = 83
export const INVEST_TENDERING_INVESTMENT_MODE_OTHER = 84
export const INVEST_TENDERING_INVESTMENT_MODE = {
  [INVEST_TENDERING_INVESTMENT_MODE_JOINT_VENTURE]: '合资',
  [INVEST_TENDERING_INVESTMENT_MODE_SOLE_PROPRIETORSHIP]: '独资',
  [INVEST_TENDERING_INVESTMENT_MODE_BT_BOT]: 'BT或BOT',
  [INVEST_TENDERING_INVESTMENT_MODE_OTHER]: '其他合作方式',
}

export const INVEST_TENDERING_INVESTMENT_MODE_OPTION = [
  {value: INVEST_TENDERING_INVESTMENT_MODE_JOINT_VENTURE, label: '合资'},
  {value: INVEST_TENDERING_INVESTMENT_MODE_SOLE_PROPRIETORSHIP, label: '独资'},
  {value: INVEST_TENDERING_INVESTMENT_MODE_BT_BOT, label: 'BT或BOT'},
  {value: INVEST_TENDERING_INVESTMENT_MODE_OTHER, label: '其他合作方式'},
]

// 文章状态
export const POST_STATUS_PUB = 'PUB'
export const POST_STATUS_DRAFT = 'DRAFT'

// 页面状态
export const PAGE_STATUS_PUB = 'PUB'
export const PAGE_STATUS_DRAFT = 'DRAFT'

// 短信任务状态
export const SMS_CAMPAIGN_STATUS_DRAFT = 'DRAFT'
export const SMS_CAMPAIGN_STATUS_PUBLISHED = 'PUBLISHED'
export const SMS_CAMPAIGN_STATUS_SENT = 'SENT'

// 短信任务状态
export const EMAIL_CAMPAIGN_STATUS_DRAFT = 'DRAFT'
export const EMAIL_CAMPAIGN_STATUS_PUBLISHED = 'PUBLISHED'
export const EMAIL_CAMPAIGN_STATUS_SENT = 'SENT'

export const VGROUP_STATUS_OPTION = [
  {
    value: 'DRAFT',
    label: '已创建'
  },
  {
    value: 'SEALED',
    label: '已归档'
  },
]

export const MEETING_STATUS_OPTION = [
  {
    value: 'DRAFT',
    label: '已创建'
  },
  {
    value: 'SEALED',
    label: '已归档'
  },
]

export const EXPO_STATUS_OPTION = [
  {
    value: 'DRAFT',
    label: '已创建'
  },
  {
    value: 'SEALED',
    label: '已归档'
  },
]

// 发送单位组类型
export const ORG_GROUP_MEMBER_KIND_RECIPIENT = 'RECIPIENT'
export const ORG_GROUP_MEMBER_KIND_LINKMAN = 'LINKMAN'
export const ORG_GROUP_MEMBER_KIND_ALL_STAFFER = 'ALL_STAFFER'

export const ORG_GROUP_MEMBER_KIND_OPTION = [
  {
    value: 'RECIPIENT',
    label: '收发人员'
  },
  {
    value: 'LINKMAN',
    label: '联络员'
  },
  {
    value: 'ALL_STAFFER',
    label: '所有人员'
  },
]

export const ORG_GROUP_MEMBER_KIND_MODE = {
  [ORG_GROUP_MEMBER_KIND_RECIPIENT]: '收发人员',
  [ORG_GROUP_MEMBER_KIND_LINKMAN]: '联络员',
  [ORG_GROUP_MEMBER_KIND_ALL_STAFFER]: '所有人员',
}

// 交易类型 枚举
export const TRADE_TRANSACTION_TYPE_OPTIONS = [
  {
    label: '求购',
    value: 'WANT_BUY',
  },
  {
    label: '出售',
    value: 'SALE',
  },
]

// 行业类型 枚举
export const TRADEINVEST_INDUSTRIES_TYPE_OPTIONS = ['金融', '地产酒店', '能源化工', '节能环保', '建筑建材', '矿产冶金',
  '基础设施', '农林牧渔', '机械机电', '交通物流', '汽车汽配', '纺织服饰', '旅游休闲','文化体育', '传媒广告', '家电数码', '家居日用',
  '食品饮料', '医疗保健', '生物医药', 'IT', '海洋开发', '商务贸易', '其他', '综合'
]

// 发布人类型枚举
export const TRADE_PUBLISHER_TYPE_OPTIONS = [
  {
    label: '厂家',
    value: 'MFR'
  },
  {
    label: '代理人',
    value: 'AGENT'
  }
]

// 项目类型枚举
export const INVESTMENT_PROJECT_TYPE_OPTIONS = [
  {
    label: '找资金',
    value: 'FUND'
  },
  {
    label: '找项目',
    value: 'PROJ'
  },
  {
    label: '招标和招商',
    value: 'BID'
  }
]

// 投资方式枚举
export const INVESTMENT_MODE_OPTIONS = [
  {
    label: '股权',
    value: 'SH'
  },
  {
    label: '债权',
    value: 'DEBT'
  },
  {
    label: '金融',
    value: 'FIN'
  },
  {
    label: 'BT/BOT项目投资',
    value: 'BOT'
  },
  {
    label: '其他',
    value: 'OTHER'
  }
]

// 融资方法枚举
export const INVESTMENT_FINANCING_OPTIONS = [
  {
    label: '股权融资',
    value: 'SH'
  },
  {
    label: '其他融资',
    value: 'OTHER'
  },
  {
    label: '整体转让',
    value: 'TRANSFER'
  },
  {
    label: '不限',
    value: 'UNLIMITED'
  }
]

// 招标和招商方式
export const INVESTMENT_TENDERING_MODE_OPTIONS = [
  {
    label: '合资',
    value: 'JOINT'
  },
  {
    label: '独资',
    value: 'SOLE'
  },
  {
    label: 'BT或BOT',
    value: 'BOT'
  },
  {
    label: '其他合作方式',
    value: 'OTHER'
  }
]

// cco合规师任务状态
export const CCO_CAMPAIGN_STATUS_PUBLISHED = 'PUBLISHED'
export const CCO_CAMPAIGN_STATUS_SENT = 'SENT'

/**
 * q-select枚举值转换
 * @param options 枚举数组
 * @param convert 需要转换的数组
 */
export function patchTransform(options, convert) {
  const transforms = []
  convert.forEach((val) => {
    const index = _.findIndex(options, ['value', val])
    if (index > -1) {
      transforms.push(options[index])
    }
  })
  return transforms.map(item => item.label).join("，")
}

export const OFFICER_ORG_OPINION_RECOMMEND = "RECOMMEND"
export const OFFICER_ORG_OPINION_DEFER = "DEFER"

// 招标和招商方式
export const OFFICER_ORG_OPINION_OPTIONS = [
  {
    label: "同意推荐",
    value: "RECOMMEND",
  },
  {
    label: "暂缓推荐",
    value: "DEFER",
  }
]

export const OFFICER_ORG_OPINION_OBJECT = {
  [OFFICER_ORG_OPINION_RECOMMEND]: '同意推荐',
  [OFFICER_ORG_OPINION_DEFER]: '暂缓推荐',
}

export const COUNTRY_ARR = ['安道尔', '阿联酋', '阿富汗', '安提瓜和巴布达', '安圭拉', '阿尔巴尼亚', '亚美尼亚', '安哥拉', '南极洲', '阿根廷', '美属萨摩亚', '奥地利', '澳大利亚', '阿鲁巴', '奥兰群岛', '阿塞拜疆', '波黑', '巴巴多斯', '孟加拉', '比利时', '布基纳法索', '保加利亚', '巴林', '布隆迪', '贝宁', '圣巴泰勒米岛', '百慕大', '文莱',
  '玻利维亚', '荷兰加勒比区', '巴西', '巴哈马', '不丹', '布韦岛', '博茨瓦纳', '白俄罗斯', '伯利兹', '加拿大', '科科斯群岛', '刚果', '中非', '刚果（布）', '瑞士', '科特迪瓦', '库克群岛', '智利', '喀麦隆', '哥伦比亚', '哥斯达黎加', '古巴', '佛得角', '库拉索', '圣诞岛', '塞浦路斯', '捷克', '德国', '吉布提', '丹麦', '多米尼克', '多米尼加', '阿尔及利亚',
  '厄瓜多尔', '爱沙尼亚', '埃及', '西撒哈拉', '厄立特里亚', '西班牙', '埃塞俄比亚', '芬兰', '斐济群岛', '马尔维纳斯群岛（ 福克兰）', '密克罗尼西亚联邦', '法罗群岛', '法国', '加蓬', '英国', '格林纳达', '格鲁吉亚', '法属圭亚那', '根西岛', '加纳', '直布罗陀', '格陵兰', '冈比亚', '几内亚', '瓜德罗普', '赤道几内亚', '希腊', '南乔治亚岛和南桑威奇群岛', '危地马拉',
  '关岛', '几内亚比绍', '圭亚那', '赫德岛和麦克唐纳群岛', '洪都拉斯', '克罗地亚', '海地', '匈牙利', '印尼', '爱尔兰', '以色列', '马恩岛', '印度', '英属印度洋领地', '伊拉克', '伊朗', '冰岛', '意大利', '泽西岛', '牙买加', '约旦', '日本', '肯尼亚', '吉尔吉斯斯坦', '柬埔寨', '基里巴斯', '科摩罗', '圣基茨和尼维斯', '朝鲜', '韩国', '科威特', '开曼群岛',
  '哈萨克斯坦', '老挝', '黎巴嫩', '圣卢西亚', '列支敦士登', '斯里兰卡', '利比里亚', '莱索托', '立陶宛', '卢森堡', '拉脱维亚', '利比亚', '摩洛哥', '摩纳哥', '摩尔多瓦', '黑山', '法属圣马丁', '马达加斯加', '马绍尔群岛', '马其顿', '马里', '缅甸', '蒙古国', '北马里亚纳群岛', '马提尼克', '毛里塔尼亚', '蒙塞拉特岛', '马耳他', '毛里求斯', '马尔代夫', '马拉维',
  '墨西哥', '马来西亚', '莫桑比克', '纳米比亚', '新喀里多尼亚', '尼日尔', '诺福克岛', '尼日利亚', '尼加拉瓜', '荷兰', '挪威', '尼泊尔', '瑙鲁', '纽埃', '新西兰', '阿曼', '巴拿马', '秘鲁', '法属波利尼西亚', '巴布亚新几内亚', '菲律宾', '巴基斯坦', '波兰', '圣皮埃尔和密克隆', '皮特凯恩群岛', '波多黎各', '巴勒斯坦', '葡萄牙', '帕劳', '巴拉圭', '卡塔尔',
  '留尼汪', '罗马尼亚', '塞尔维亚', '俄罗斯', '卢旺达', '沙特阿拉伯', '所罗门群岛', '塞舌尔', '苏丹', '瑞典', '新加坡', '圣赫勒拿', '斯洛文尼亚', '斯瓦尔巴群岛和扬马延岛', '斯洛伐克', '塞拉利昂', '圣马力诺', '塞内加尔', '索马里', '苏里南', '南苏丹', '圣多美和普林西比', '萨尔瓦多', '圣马丁', '叙利亚', '斯威士兰', '特克斯和凯科斯群岛', '乍得', '法属南部领地',
  '多哥', '泰国', '塔吉克斯坦', '托克劳', '东帝汶', '土库曼斯坦', '突尼斯', '汤加', '土耳其', '特立尼达和多巴哥', '图瓦卢', '坦桑尼亚', '乌克兰', '乌干达', '美国本土外小岛屿', '美国', '乌拉圭', '乌兹别克斯坦', '梵蒂冈', '圣文森特和格林纳丁斯', '委内瑞拉', '英属维尔京群岛', '美属维尔京群岛', '越南', '瓦努阿图', '瓦利斯和富图纳', '萨摩亚', '也门', '马约特', '南非', '赞比亚', '津巴布韦']

export const PROVINCE_ARR = ['北京市','上海市','天津市','重庆市','河北省','山西省','黑龙江省','吉林省','辽宁省','江苏省','浙江省','安徽省','福建省', '江西省','山东省','河南省','湖北省','湖南省','广东省','海南省','四川省','贵州省','云南省','陕西省', '甘肃省','青海省','内蒙古自治区','广西壮族自治区','西藏自治区','宁夏回族自治区', '新疆维吾尔自治区']

export const CAPTCHA_SCOPE_LOGIN = 'login'
export const CAPTCHA_SCOPE_RESET_PASSWORD = 'resetPassword'
export const CAPTCHA_SCOPE_2FA = '2FA'
export const CAPTCHA_SCOPE_UPDATE_PHONE_NUMBER = 'updatePhoneNumber'
export const CAPTCHA_SCOPE_UPDATE_EMAIL = 'updateEmail'

export const CAPTCHA_SCOPE_OBJECT = {
  [CAPTCHA_SCOPE_LOGIN]: '登录',
  [CAPTCHA_SCOPE_RESET_PASSWORD]: '修改密码',
  [CAPTCHA_SCOPE_2FA]: '验证身份',
  [CAPTCHA_SCOPE_UPDATE_PHONE_NUMBER]: '绑定手机号',
  [CAPTCHA_SCOPE_UPDATE_EMAIL]: '绑定邮箱',
}

export const DOWNLOAD_APP_URL = 'https://work.ccpit.org/dendenmushi/releases/latest/android/ccpit.apk';
